-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make dialog region focusable via keyboard #2428
Conversation
Co-authored-by: Erinna Chen <[email protected]>
🦋 Changeset detectedLatest commit: 183d574 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Looks good, would it be easy to add a system test to load the long_text preview? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving for now, but @jonrohan is right, let's add a test!
@jonrohan & @camertron - thanks for the suggestion, I added that system test! I decided to write a full test asserting the focus behavior, as it seemed better to me than just loading the preview and relying on the Axe scan to detect failures, but if you think this test could become too brittle or flakey (I don't love sending the What do you think? Edit: okay the system test is already failing in the CI suite, but was passing in my Codespace. Maybe it would be better to just run the preview and let Axe do the scanning. |
Yeah I'm ok with that for now. We can always improve the system test later if there are any regressions. |
Authors: Please fill out this form carefully and completely.
Reviewers: By approving this Pull Request you are approving the code change, as well as its deployment and mitigation plans.
Please read this description carefully. If you feel there is anything unclear or missing, please ask for updates.
What are you trying to accomplish?
This PR adds the ability to use the keyboard to navigate to a Dialog's scrollable body, which is currently inaccessible to keyboard users.
When a dialog body contains overflown content, the newly added
<scrollable-region>
element will automatically add the necessary HTML attributes to make the region focusable and screen-reader friendly.This is a very similar approach that I used to fix the same issue in the React version of the Dialog component.
Screenshots
Integration
List the issues that this change affects.
Closes https://github.com/github/accessibility-audits/issues/5453 (GitHub staff only)
Additional context: https://github.com/github/primer/issues/2698 (GitHub staff only)
Risk Assessment
What approach did you choose and why?
Anything you want to highlight for special attention from reviewers?
Accessibility
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.